<?php

namespace App\Models;

use App\Jobs\SendChangeOrderMessage;
use App\Services\AlipayMessageService;
use App\Services\AlipayMiniOrderService;
use App\Services\CommonService;
use App\Services\EducationService;
use App\Services\OrderService;
use App\Services\RedisLock;
use App\Services\RedisService;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Http\Request;
use Illuminate\Testing\Fluent\Concerns\Has;

class OtherRiskLog extends Model
{
    use HasFactory;
    protected $table = 'sp_other_risk_log';
    protected $primaryKey = 'id';
    public $timestamps = false;
    //查询地区

    public  function insertFlowMember($risk_user_id,$cert_no,$cert_name,$mobile,$trans_no,$area,$age,$custom,$data)
    {
        $data=[
            'risk_user_id'=>$risk_user_id,
            'cert_no'=>$cert_no,
            'cert_name'=>$cert_name,
            'mobile'=>$mobile,
            'trans_no'=>$trans_no,
            'area'=>$area,
            'age'=>$age,
            'custom'=>$custom,
            'flowNo'=>$data['meta']['sn']??'',
            'create_time'=>date('Y-m-d H:i:s'),
            'risk_level'=>$data['data']['level']??'',
            'result'=>json_encode($data, JSON_UNESCAPED_UNICODE),
        ];
        return self::query()->insert($data);
    }

}
